package com.softwareconstruction.service;

import com.softwareconstruction.model.Paper;
import com.softwareconstruction.exception.NoEnoughPapersException;
import java.util.List;
import java.util.stream.Collectors;

public class SequentialSelectionStrategy implements SelectionStrategy {
    @Override
    public List<Paper> selectPapers(List<Paper> papers, int requiredCount) throws NoEnoughPapersException {
        if (papers.size() < requiredCount) {
            throw new NoEnoughPapersException("Not enough papers available for selection");
        }
        return papers.stream().limit(requiredCount).collect(Collectors.toList());
    }
}